from fastapi import FastAPI

# docs_url=None: 代表关闭SwaggerUi
# redoc_url=None: 代表关闭redoc文档
# app = FastAPI(docs_url=None, redoc_url=None)

app = FastAPI()


@app.get("/")
async def index():
    return {"msg": "Hello World!"}


@app.get("/items/{item_id}")
async def get_item(item_id: int, q: str = None):
    return {"item_id": item_id, "q": q}

@app.get("/users/me")
async def get_user_me():
    return {"user_id": "current_user info..."}

@app.get("/users/{user_id}")
async def get_user(user_id: str):
    return {"user_id": user_id}